import java.util.Arrays;

/**
 * @ClassDescription:
 * @JdkVersion: 1.8
 * @Author: 李白
 * @Created: 2024/4/11 19:19
 */
//int a = new int()
class Base{
    public Base(String s){
        System.out.print("B");
    }
}

class Derived extends Base{
    /**
     * 子类默认有一个构造方法,如下行注释
     * @param s
     */
   /* public Derived (String s）{
        super(s);
    }*/
    public Derived (String s) {
        super(s);
        System.out.print("D");
    }
    public static void main(String[] args){
        new Derived("C");
    }
}
public class Test {
    public static void main(String[] args) {
        
    }
    class Dog extends Animal{

    }
    class Animal{

    }












    //给定两个整型数组, 交换两个数组的内容.
    public static void main2(String[] args) {
        int[] a = {1,3,5,7,9};
        int[] b = {2,4,6,8,10};
        for (int i = 0; i < a.length; i++) {
            int tmp = a[i];
            a[i] = b[i];
            b[i] = tmp;
        }
        System.out.println(Arrays.toString(a));
        System.out.println(Arrays.toString(b));
    }
    //给定整型数组, 把所有的偶数放到数组前面, 把所有奇数放到数组后面.
    public static void main1(String[] args) {
        int[] array = {1,3,5,7,11,9,2,4,6,22};
        int i = 0;
        int j = array.length-1;
        while (i<j){
            while (i<j && array[i]%2 == 0){
                i++;
            }
            while (i<j && array[j]%2 == 1){
                j--;
            }
            int tmp = array[i];
            array[i] = array[j];
            array[j] = tmp;
        }
        System.out.println(Arrays.toString(array));
    }
}
